# -!- coding: utf-8 -!-
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
#作者：cacho_37967865
#博客：https://blog.csdn.net/sinat_37967865
#文件：get_repay_date.py
#日期：2019-11-1
#备注：获取某期的到期还款日
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

from pycacho.cachobase.deal_time import next_date_fixed


# 获取某期的到期还款日：固定日期(参数：开始日期，总期数)
def fix_day(str_day,n_day):
    all_days = []
    fix_days = [10,11,13,14]
    for i in range(1,n_day+1):                    # 第N期
        for day in fix_days:
            all_days.append(next_date_fixed(str_day,i,day))
    #print(all_days)
    return all_days


# 固定日期(参数：开始日期，总期数)
def fix_two_day(str_day,n_day):
    all_day = []
    for i in range(1,n_day+1):
        b_day = next_date_fixed(str_day,i,2)       # 开始日，期数，到期日
        all_day.append(b_day)
        r_day = next_date_fixed(str_day,i,3)       # 开始日，期数，到期日
        all_day.append(r_day)

    #print(all_day)
    return all_day

if __name__ == '__main__':
    fix_day('2022-11-30', 1)